add_rules("mode.debug", "mode.release")
--    add_cxflags("-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith -Wstrict-aliasing=1", {force = true})

if is_plat("qnx") then
    includes("toolchains/qnx_sdp7.0.lua")
    set_toolchains("QNX_SDP7.0")
    add_includedirs("~/workspace/tools/QNX_SDP7.0/target/qnx7/usr/include")
    add_linkdirs("~/workspace/tools/QNX_SDP7.0/target/qnx7/aarch64le/usr/lib")
    add_syslinks("c++", "screen")	
end

if is_plat("windows") then
    add_requires("libsdl")
end

option("qnx_screen")
	add_cincludes("screen.h")
	add_links("screen")
	add_defines("HAS_QNX_SCREEN")

option("posix_pthread")
	add_cincludes("pthread.h")
	add_links("pthread")
	add_defines("HAS_POSIX_THREAD=1")    

target("kfa_player")
    add_options("qnx_screen", "posix_pthread")
	--set_plat("qnx")
    set_kind("binary")
    set_languages("c++11")
    add_deps("libkfa")
    add_links("libkfa")
    add_files("./*.cpp")
    if is_plat("windows") then
        add_packages("libsdl")
    end